<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"> <style>
	.KEYW {color: #933;}
	.COMM {color: #bbb; font-style: italic;}
	.NUMB {color: #393;}
	.STRN {color: #393;}
	.REGX {color: #339;}
	.line {border-right: 1px dotted #666; color: #666; font-style: normal;}
	</style></head><body><pre><span class='line'>  1</span> <span class="COMM">/**
<span class='line'>  2</span>  * Copyright (c) 2009, Microsoft
<span class='line'>  3</span>  * All rights reserved.
<span class='line'>  4</span>  *
<span class='line'>  5</span>  * Redistribution and use in source and binary forms, with or without
<span class='line'>  6</span>  * modification, are permitted provided that the following conditions are met:
<span class='line'>  7</span>  *     * Redistributions of source code must retain the above copyright
<span class='line'>  8</span>  *       notice, this list of conditions and the following disclaimer.
<span class='line'>  9</span>  *     * Redistributions in binary form must reproduce the above copyright
<span class='line'> 10</span>  *       notice, this list of conditions and the following disclaimer in the
<span class='line'> 11</span>  *       documentation and/or other materials provided with the distribution.
<span class='line'> 12</span>  *     * Neither the name of Microsoft nor the
<span class='line'> 13</span>  *       names of its contributors may be used to endorse or promote products
<span class='line'> 14</span>  *       derived from this software without specific prior written permission.
<span class='line'> 15</span>  *
<span class='line'> 16</span>  * THIS SOFTWARE IS PROVIDED BY Microsoft ''AS IS'' AND ANY
<span class='line'> 17</span>  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
<span class='line'> 18</span>  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
<span class='line'> 19</span>  * DISCLAIMED. IN NO EVENT SHALL Microsoft BE LIABLE FOR ANY
<span class='line'> 20</span>  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
<span class='line'> 21</span>  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
<span class='line'> 22</span>  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
<span class='line'> 23</span>  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
<span class='line'> 24</span>  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
<span class='line'> 25</span>  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<span class='line'> 26</span>  *
<span class='line'> 27</span>  * @category   Microsoft
<span class='line'> 28</span>  * @package    WebErrorPHPToolkit
<span class='line'> 29</span>  * @subpackage Error
<span class='line'> 30</span>  * @version    $Id: sting_builder.js, v 1.0 2009-10-09 08:00:00Z unknown $
<span class='line'> 31</span>  * @copyright  Copyright (c) 2009, Microsoft (http://www.microsoft.com)
<span class='line'> 32</span>  * @author     a-jetann
<span class='line'> 33</span>  *
<span class='line'> 34</span>  * The StringBuilder class only provides four methods:
<span class='line'> 35</span>  * a constructor, 
<span class='line'> 36</span>  * an append method,
<span class='line'> 37</span>  * a clear method, and
<span class='line'> 38</span>  * a toString method.
<span class='line'> 39</span>  */</span><span class="WHIT">
<span class='line'> 40</span> 
<span class='line'> 41</span> </span><span class="COMM">/**
<span class='line'> 42</span>  * Initializes a new instance of the StringBuilder class
<span class='line'> 43</span>  * and appends the given value if supplied
<span class='line'> 44</span>  *
<span class='line'> 45</span>  * @param value string Start of string being built.
<span class='line'> 46</span>  */</span><span class="WHIT">
<span class='line'> 47</span> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="NAME">StringBuilder</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 48</span> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 49</span> </span><span class="WHIT">  </span><span class="NAME">this.strings</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">new</span><span class="WHIT"> </span><span class="NAME">Array</span><span class="PUNC">(</span><span class="STRN">""</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 50</span> </span><span class="WHIT">  </span><span class="NAME">this.append</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 51</span> </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 52</span> 
<span class='line'> 53</span> </span><span class="COMM">/**
<span class='line'> 54</span>  * Appends the given value to the end of this instance.
<span class='line'> 55</span>  *
<span class='line'> 56</span>  * @param value string String be appended.
<span class='line'> 57</span>  */</span><span class="WHIT">
<span class='line'> 58</span> </span><span class="NAME">StringBuilder.prototype.append</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 59</span> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 60</span> </span><span class="WHIT">  </span><span class="KEYW">if</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 61</span> </span><span class="WHIT">  </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 62</span> </span><span class="WHIT">    </span><span class="NAME">this.strings.push</span><span class="PUNC">(</span><span class="NAME">value</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 63</span> </span><span class="WHIT">  </span><span class="PUNC">}</span><span class="WHIT">
<span class='line'> 64</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 65</span> 
<span class='line'> 66</span> </span><span class="COMM">/**
<span class='line'> 67</span>  * Clears the string buffer
<span class='line'> 68</span>  */</span><span class="WHIT">
<span class='line'> 69</span> </span><span class="NAME">StringBuilder.prototype.clear</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 70</span> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 71</span> </span><span class="WHIT">  </span><span class="NAME">this.strings.length</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="NUMB">1</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 72</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 73</span> 
<span class='line'> 74</span> </span><span class="COMM">/**
<span class='line'> 75</span>  * Converts this instance to a String.
<span class='line'> 76</span>  */</span><span class="WHIT">
<span class='line'> 77</span> </span><span class="NAME">StringBuilder.prototype.toString</span><span class="WHIT"> </span><span class="PUNC">=</span><span class="WHIT"> </span><span class="KEYW">function</span><span class="WHIT"> </span><span class="PUNC">(</span><span class="PUNC">)</span><span class="WHIT">
<span class='line'> 78</span> </span><span class="PUNC">{</span><span class="WHIT">
<span class='line'> 79</span> </span><span class="WHIT">  </span><span class="KEYW">return</span><span class="WHIT"> </span><span class="NAME">this.strings.join</span><span class="PUNC">(</span><span class="STRN">""</span><span class="PUNC">)</span><span class="PUNC">;</span><span class="WHIT">
<span class='line'> 80</span> </span><span class="PUNC">}</span><span class="PUNC">;</span><span class="WHIT"> </span></pre></body></html>